﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Xml.Serialization;
using System.IO;
using System.Collections.ObjectModel;

namespace BDSim
{
    public class InjectionStation : StationBase
    {
        public InjectionStation()
        {            
            DataProvider.Parent = this;
            
            DataProvider.DefineCommand();
            this.Menu.ItemsSource = DataProvider.MenuCommandList;            
        }

        #region 字段


        InjectionStationDataProvider _DataProvider = new InjectionStationDataProvider();

        private ObservableCollection<SendReceiveDevice> _InjectSendReceivers = new ObservableCollection<SendReceiveDevice>();
  
        private int _IsObsFlag = 0; //是否已生成观测数据标志（根据建链表一次性生成观测数据）

        #endregion 

        #region 属性

        [XmlIgnore, Browsable(false)]
        public InjectionStationDataProvider DataProvider
        {
            get { return _DataProvider; }
            set { _DataProvider = value; }
        }

        [Browsable(false)]
        public ObservableCollection<SendReceiveDevice> InjectSendReceivers
        {
            get { return _InjectSendReceivers; }
            set { _InjectSendReceivers = value; }
        }
    
        #endregion

        #region 初始化
        public override void Init()
        {
            //站钟差仿真
            ClkErrCal();

            bool IsGenerateObsDataFlag = (Parent.Parent.Parent.Parent as Scenario).IsGenerateObsData;

            //观测数据生成  
            if (IsGenerateObsDataFlag == true && _IsObsFlag == 0)
            {
                _IsObsFlag = 1;
            }

            //初始化完成反馈任务执行量
            DlgAddCompleteMission();
        }
        #endregion

        #region 单步运行
        public override void StepRun()
        {

        }
        #endregion

        #region 方法


        #endregion
    }
}
